package com.example.common.exception.job;

/**
 * 计划策略异常
 */
public class TaskException extends Exception {
    private static final long serialVersionUID = 1L;
    private Code code;

    public Code getCode() {
        return code;
    }

    public TaskException() {

    }

    public TaskException(String message, Code code) {
        super(message);
        this.code = code;
    }

    public TaskException(Code code, String message, Exception nestedEx) {
        super(message, nestedEx);
        this.code = code;
    }

    public enum Code {
        TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN_ERROR, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE,
    }
}
